﻿using System;
using System.Windows.Forms;

namespace Packet_AC_A
{
    public partial class frmShortcuts : Form
    {
        public frmShortcuts()
        {
            InitializeComponent();
        }

        private void btnStorage_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Visual_Basic_.NET");
            System.Diagnostics.Process.Start("http://msdn.microsoft.com/en-us/library/67ef8sbd.aspx");
        }

        private void cbxSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            olv1.ShowGroups = false;
            switch (cbxSelector.Text)
            {
                case "Lookup DLLs":
                    olv1.ShowGroups = true;
                    olv1.SetObjects(PHelp.Data_Classes.Reference.GetReferences());

                    BrightIdeasSoftware.Generator.GenerateColumns(olv1, Type.GetType(new PHelp.Data_Classes.Base_Shortcut().GetType().FullName));
                    olv1.BuildGroups(olv1.GetColumn(0), SortOrder.Ascending, olv1.GetColumn(1), SortOrder.Ascending, olv1.GetColumn(1), SortOrder.Ascending);
                    foreach (BrightIdeasSoftware.OLVGroup Item in olv1.OLVGroups)
                    {
                        Item.Collapsed = true;
                    }
                    break;
                case "Software":
                    olv1.ShowGroups = true;
                    olv1.SetObjects(PHelp.Data_Classes.Software.GetSoftware());

                    BrightIdeasSoftware.Generator.GenerateColumns(olv1, Type.GetType(new PHelp.Data_Classes.Base_Shortcut().GetType().FullName));
                    olv1.BuildGroups(olv1.GetColumn(0), SortOrder.Ascending, olv1.GetColumn(1), SortOrder.Ascending, olv1.GetColumn(1), SortOrder.Ascending);
                    foreach (BrightIdeasSoftware.OLVGroup Item in olv1.OLVGroups)
                    {
                        Item.Collapsed = true;
                    }
                    break;
                default:
                    break;
            }
        }

        private void olv1_SelectedIndexChanged(object sender, EventArgs e)
        {
            propertyGrid1.SelectedObject = olv1.SelectedObject;
        }
    }
}